home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / MachineExceptions.a < prev    next >
Text File  |  1996-05-01  |  6KB  |  192 lines

  1. ;
  2. ;    File:        MachineExceptions.a
  3. ;
  4. ;    Contains:    Processor Exception Handling Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__MACHINEEXCEPTIONS__') = 'UNDEFINED' THEN
  19. __MACHINEEXCEPTIONS__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
  25. ;  Some basic declarations used throughout the kernel 
  26.  
  27.  
  28. ;  Machine Dependent types for PowerPC: 
  29. MachineInformationPowerPC RECORD 0
  30. CTR                         ds        UnsignedWide    ; offset: $0 (0)
  31. LR                         ds        UnsignedWide    ; offset: $8 (8)
  32. PC                         ds        UnsignedWide    ; offset: $10 (16)
  33. CR                         ds.l    1                ; offset: $18 (24)
  34. XER                         ds.l    1                ; offset: $1C (28)
  35. MSR                         ds.l    1                ; offset: $20 (32)
  36. MQ                         ds.l    1                ; offset: $24 (36)
  37. ExceptKind                 ds.l    1                ; offset: $28 (40)
  38. DSISR                     ds.l    1                ; offset: $2C (44)
  39. DAR                         ds        UnsignedWide    ; offset: $30 (48)
  40. Reserved                 ds        UnsignedWide    ; offset: $38 (56)
  41. sizeof                     EQU *                    ; size:   $40 (64)
  42.                         ENDR
  43. RegisterInformationPowerPC RECORD 0
  44. R0                         ds        UnsignedWide    ; offset: $0 (0)
  45. R1                         ds        UnsignedWide    ; offset: $8 (8)
  46. R2                         ds        UnsignedWide    ; offset: $10 (16)
  47. R3                         ds        UnsignedWide    ; offset: $18 (24)
  48. R4                         ds        UnsignedWide    ; offset: $20 (32)
  49. R5                         ds        UnsignedWide    ; offset: $28 (40)
  50. R6                         ds        UnsignedWide    ; offset: $30 (48)
  51. R7                         ds        UnsignedWide    ; offset: $38 (56)
  52. R8                         ds        UnsignedWide    ; offset: $40 (64)
  53. R9                         ds        UnsignedWide    ; offset: $48 (72)
  54. R10                         ds        UnsignedWide    ; offset: $50 (80)
  55. R11                         ds        UnsignedWide    ; offset: $58 (88)
  56. R12                         ds        UnsignedWide    ; offset: $60 (96)
  57. R13                         ds        UnsignedWide    ; offset: $68 (104)
  58. R14                         ds        UnsignedWide    ; offset: $70 (112)
  59. R15                         ds        UnsignedWide    ; offset: $78 (120)
  60. R16                         ds        UnsignedWide    ; offset: $80 (128)
  61. R17                         ds        UnsignedWide    ; offset: $88 (136)
  62. R18                         ds        UnsignedWide    ; offset: $90 (144)
  63. R19                         ds        UnsignedWide    ; offset: $98 (152)
  64. R20                         ds        UnsignedWide    ; offset: $A0 (160)
  65. R21                         ds        UnsignedWide    ; offset: $A8 (168)
  66. R22                         ds        UnsignedWide    ; offset: $B0 (176)
  67. R23                         ds        UnsignedWide    ; offset: $B8 (184)
  68. R24                         ds        UnsignedWide    ; offset: $C0 (192)
  69. R25                         ds        UnsignedWide    ; offset: $C8 (200)
  70. R26                         ds        UnsignedWide    ; offset: $D0 (208)
  71. R27                         ds        UnsignedWide    ; offset: $D8 (216)
  72. R28                         ds        UnsignedWide    ; offset: $E0 (224)
  73. R29                         ds        UnsignedWide    ; offset: $E8 (232)
  74. R30                         ds        UnsignedWide    ; offset: $F0 (240)
  75. R31                         ds        UnsignedWide    ; offset: $F8 (248)
  76. sizeof                     EQU *                    ; size:   $100 (256)
  77.                         ENDR
  78. FPUInformationPowerPC    RECORD 0
  79. Registers                 ds.b    32 * UnsignedWide.sizeof ; offset: $0 (0)
  80. FPSCR                     ds.l    1                ; offset: $100 (256)
  81. Reserved                 ds.l    1                ; offset: $104 (260)
  82. sizeof                     EQU *                    ; size:   $108 (264)
  83.                         ENDR
  84. ;  Exception related declarations 
  85.  
  86. kWriteReference                    EQU        0
  87. kReadReference                    EQU        1
  88. kFetchReference                    EQU        2
  89. writeReference                    EQU        0                    ; Obsolete name
  90. readReference                    EQU        1                    ; Obsolete name
  91. fetchReference                    EQU        2                    ; Obsolete name
  92. ; typedef unsigned long                 MemoryReferenceKind
  93.  
  94. MemoryExceptionInformation RECORD 0
  95. theArea                     ds.l    1                ; offset: $0 (0)
  96. theAddress                 ds.l    1                ; offset: $4 (4)
  97. theError                 ds.l    1                ; offset: $8 (8)
  98. theReference             ds.l    1                ; offset: $C (12)
  99. sizeof                     EQU *                    ; size:   $10 (16)
  100.                         ENDR
  101.  
  102. kUnknownException                EQU        0
  103. kIllegalInstructionException    EQU        1
  104. kTrapException                    EQU        2
  105. kAccessException                EQU        3
  106. kUnmappedMemoryException        EQU        4
  107. kExcludedMemoryException        EQU        5
  108. kReadOnlyMemoryException        EQU        6
  109. kUnresolvablePageFaultException    EQU        7
  110. kPrivilegeViolationException    EQU        8
  111. kTraceException                    EQU        9
  112. kInstructionBreakpointException    EQU        10
  113. kDataBreakpointException        EQU        11
  114. kIntegerException                EQU        12
  115. kFloatingPointException            EQU        13
  116. kStackOverflowException            EQU        14
  117. kTaskTerminationException        EQU        15
  118. kTaskCreationException            EQU        16
  119.     IF OLDROUTINENAMES THEN
  120.  
  121. unknownException                EQU        0                    ; Obsolete name
  122. illegalInstructionException        EQU        1                    ; Obsolete name
  123. trapException                    EQU        2                    ; Obsolete name
  124. accessException                    EQU        3                    ; Obsolete name
  125. unmappedMemoryException            EQU        4                    ; Obsolete name
  126. excludedMemoryException            EQU        5                    ; Obsolete name
  127. readOnlyMemoryException            EQU        6                    ; Obsolete name
  128. unresolvablePageFaultException    EQU        7                    ; Obsolete name
  129. privilegeViolationException        EQU        8                    ; Obsolete name
  130. traceException                    EQU        9                    ; Obsolete name
  131. instructionBreakpointException    EQU        10                    ; Obsolete name
  132. dataBreakpointException            EQU        11                    ; Obsolete name
  133. integerException                EQU        12                    ; Obsolete name
  134. floatingPointException            EQU        13                    ; Obsolete name
  135. stackOverflowException            EQU        14                    ; Obsolete name
  136. terminationException            EQU        15                    ; Obsolete name
  137. kTerminationException            EQU        15                    ; Obsolete name
  138.     ENDIF
  139. ; typedef unsigned long                 ExceptionKind
  140.  
  141. ExceptionInfo            RECORD 0
  142. memoryInfo                 ds.l    1                ; offset: $0 (0)
  143. sizeof                     EQU *                    ; size:   $4 (4)
  144.                         ENDR
  145. ExceptionInformationPowerPC RECORD 0
  146. theKind                     ds.l    1                ; offset: $0 (0)
  147. machineState             ds.l    1                ; offset: $4 (4)
  148. registerImage             ds.l    1                ; offset: $8 (8)
  149. FPUImage                 ds.l    1                ; offset: $C (12)
  150. info                     ds        ExceptionInfo    ; offset: $10 (16)
  151. sizeof                     EQU *                    ; size:   $14 (20)
  152.                         ENDR
  153. ExceptionInformation    RECORD 0
  154. f                         ds        ExceptionInformationPowerPC
  155. sizeof                     EQU *                    ; size:   $14 (20)
  156.                         ENDR
  157.  
  158.  
  159. MachineInformation        RECORD 0
  160. f                         ds        MachineInformationPowerPC
  161. sizeof                     EQU *                    ; size:   $40 (64)
  162.                         ENDR
  163.  
  164.  
  165. RegisterInformation        RECORD 0
  166. f                         ds        RegisterInformationPowerPC
  167. sizeof                     EQU *                    ; size:   $100 (256)
  168.                         ENDR
  169.  
  170.  
  171. FPUInformation            RECORD 0
  172. f                         ds        FPUInformationPowerPC
  173. sizeof                     EQU *                    ; size:   $108 (264)
  174.                         ENDR
  175.  
  176.  
  177. ;
  178. ; Note:    An ExceptionHandler is NOT a UniversalProcPtr.
  179. ;            It must be a PowerPC function pointer with NO routine descriptor. 
  180. ;
  181. ;  Routine for installing per-process exception handlers 
  182. ;
  183. ; pascal ExceptionHandler InstallExceptionHandler(ExceptionHandler theHandler, void *refcon)
  184. ;
  185.     IF GENERATINGCFM THEN
  186.         IMPORT_CFM_FUNCTION InstallExceptionHandler
  187.     ENDIF
  188.  
  189.     ENDIF
  190.     ENDIF ; __MACHINEEXCEPTIONS__ 
  191.  
  192.